<template>
  <section class="goods_item"
    @click='goToInfo(itemInfo.product_id)'>
    <img alt=""
      :src="itemInfo.image">
    <div class="class_info">
      <h6 class="title_name">{{itemInfo.product}}</h6>
      <div class="details">
        <span class="text_details">{{itemInfo.text}}</span>
        <span class="price">
          {{itemInfo.price}}
          <span>元</span>
        </span>
      </div>
    </div>
  </section>
</template>
<script>
export default {
  name:'goods',
  data(){
    return{

    }
  },
  props:['itemInfo'],
  methods:{
    goToInfo(id){
      this.$router.push({path:'/shopInfo',query: {id}})
    }
  }
}
</script>
<style>
.goods_item{
  width: 30%;
  height: 320px;
  display: inline-block;
  margin-bottom:45px; 
  margin-right:3%;
  transition: 1s;
  background-color: #fff;

}
.goods_item:hover{
  transform:translateY(-10px);
  border-top:1px solid red;
  box-shadow: 0px 2px 6px rgba(0,0,0,.5);
}
.goods_item img{
  height:250px;
}
.title_name{
  margin-bottom:5px;
  font-size: 18px;
}
.class_info{
  padding:0 10px;
}
.details{
  display: flex;
  justify-content: space-between;
}
.price{
  color:red;
  font-size: 22px;
}
.price span{
  font-size: 16px;
}
</style>

